package swingFiles;

import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JButton;

/**
 * Creates the panel for the staff of the gym management system
 * 
 * @author Emily Linniman
 * @version December 1, 2014
 *
 */
@SuppressWarnings("serial")
public class StaffHome extends JPanel {

	/** The frame on which the panel is placed on. */
	private JFrame my_frame;
	
	/**
	 * Create the panel.
	 */
	public StaffHome(JFrame the_frame) {
		my_frame = the_frame;
		setBackground(Color.ORANGE);
		setLayout(null);
		
		JLabel welcomeLabel = new JLabel("Welcome Staff Member!");
		welcomeLabel.setBounds(132, 6, 193, 16);
		welcomeLabel.setFont(new Font("Arial", Font.PLAIN, 18));
		add(welcomeLabel);
		
		JButton logoutButton = new JButton("Logout");
		logoutButton.setBounds(132, 184, 178, 29);
		logoutButton.setFont(new Font("Arial", Font.PLAIN, 15));
		logoutButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) { 
				my_frame.setContentPane(new LogIn(my_frame));
				my_frame.validate();
				my_frame.setVisible(true);
			}
		});
		add(logoutButton);
		
		JButton registerButton = new JButton("Register Member");
		registerButton.setBounds(132, 70, 178, 29);
		registerButton.setFont(new Font("Arial", Font.PLAIN, 15));
		add(registerButton);
		
		JButton addMemberButton = new JButton("Add Member to Class");
		addMemberButton.setBounds(132, 126, 178, 29);
		addMemberButton.setFont(new Font("Arial", Font.PLAIN, 15));
		add(addMemberButton);

	}
}
